<?php
  /*
    查询列表
   */
$db = new mysqli("10.19.5.9","liupanpan","123","qingbao_db");
if ($db->connect_errno) {
    printf("Connect failed: %s\n", $db->connect_error);
    exit();
}
mysqli_set_charset($db, "utf8");
  
$sum="select count(*) from train_corpus_final where manual_annotation ='0'";
$count=$db->query($sum);
$sums=$count->fetch_array();

$page=$_POST['page'];
$pagesize=100;
$start=($page-1)*$pagesize;
$sql="select * from train_corpus_final WHERE manual_annotation ='0' limit $start ,$pagesize ";//查询遍历  
$result = $db->query($sql);
$res=[]; 
   
if ($result->num_rows>0){    
    while($rows = $result->fetch_array()){     
		$temp = $rows;
		$temp['content'] = strip_tags($temp['content'],"<p>");
        $res['list'][]=$temp;
    }
    $res['sum']=$sums[0];
    $res['page']=ceil($res['sum']/$pagesize) ;
    print_r( json_encode($res));
}else{    
    //echo "查询结果为空！"; 
    return false;      
}   



?>